package com.htfyun.ft.viewmodel;


import com.htfyun.ft.fragment.factory.FactoryTestItemsEnum;

import java.util.List;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class ViewModelFT extends ViewModel {

    private MutableLiveData<Boolean> autoTest;

    private MutableLiveData<List<FactoryTestItemsEnum>> factoryTestItemsEnumList;

    private MutableLiveData<FTAction> FTAction;

    private MutableLiveData<FactoryTestItemsEnum> clickedItem;

    public MutableLiveData<FactoryTestItemsEnum> getClickedItem() {
        if (clickedItem == null) {
            synchronized (ViewModelFT.class) {
                clickedItem = new MutableLiveData<>();
            }
        }
        return clickedItem;
    }

    public void setClickedItem(FactoryTestItemsEnum clickedItem) {
        getClickedItem().postValue(clickedItem);
    }

    public MutableLiveData<Boolean> getAutoTest() {
        if (autoTest == null) {
            synchronized (ViewModelFT.class) {
                autoTest = new MutableLiveData<>();
            }
        }
        return autoTest;
    }

    public void setAutoTest(Boolean autoTest) {
        getAutoTest().postValue(autoTest);
    }

    public MutableLiveData<FTAction> getFTAction() {
        if (FTAction == null) {
            synchronized (ViewModelFT.class) {
                FTAction = new MutableLiveData<>();
            }
        }

        return FTAction;
    }

    public void setFTAction(FTAction FTAction) {
        getFTAction().postValue(FTAction);
    }

    public MutableLiveData<List<FactoryTestItemsEnum>> getFactoryTestItemsEnumList() {
        if (factoryTestItemsEnumList == null) {
            synchronized (ViewModelFT.class) {
                factoryTestItemsEnumList = new MutableLiveData<>();
            }
        }
        return factoryTestItemsEnumList;
    }

    public void setFactoryTestItemsEnumList(List<FactoryTestItemsEnum> factoryTestItemsEnumList) {
        getFactoryTestItemsEnumList().postValue(factoryTestItemsEnumList);
    }
}
